package com.mz.mattress.client.plan;

import com.mz.mattress.api.redis.RedisClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

@Service
public class BeanHolder {

    private static RedisTemplate<String, Object> redisTemplate;

    private static RedisClient redisClient;

    public static RedisTemplate<String, Object> getRedisTemplate() {
        return redisTemplate;
    }

    public static RedisClient getRedisClient() {
        return redisClient;
    }

    @Autowired
    public void setRedisTemplate(RedisTemplate<String, Object> redisTemplate) {
        BeanHolder.redisTemplate = redisTemplate;
    }

    @Autowired
    public void setRedisClient(RedisClient redisClient) {
        BeanHolder.redisClient = redisClient;
    }


}
